package com.zr.util;

import lombok.Data;

/**
 * Created by 天赐 on 2019/12/20.
 */
@Data
public class ResultVoBuilder {
    public static<T> ResultVo success(T data){
        ResultVo resultVo = new ResultVo();
        resultVo.setSuccess(true);
        resultVo.setData(data);
        return resultVo;
    }
    public static<T> ResultVo success(){
        ResultVo resultVo = new ResultVo();
        resultVo.setSuccess(true);
        resultVo.setData(null);
        return resultVo;
    }
    public static<T> ResultVo error(String errorMessage){
        ResultVo resultVo = new ResultVo();
        resultVo.setSuccess(false);
        resultVo.setErrorMessage(errorMessage);
        return resultVo;
    }

}
